package com.jams.goodox.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by Jin on 2016/7/1.
 * Description
 */
public class CustomFragmentPagerAdapter extends FragmentPagerAdapter {

	private List<Fragment> fragmentList;
	private List<String> tabsTitle;

	public CustomFragmentPagerAdapter(FragmentManager fm, List<String> tabsTitle, List<Fragment> fragmentList) {
		super(fm);
		this.tabsTitle = tabsTitle;
		this.fragmentList = fragmentList;
	}

	@Override
	public Fragment getItem(int position) {
		return fragmentList.get(position);
	}

	@Override
	public int getCount() {
		return tabsTitle.size();
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
//		super.destroyItem(container, position, object);
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return tabsTitle.get(position);
	}
}
